import 'package:flutter/material.dart';

class CustomScrollViewCase extends StatelessWidget{
  const CustomScrollViewCase({super.key});
  
  @override
  Widget build(BuildContext context) {
  return  CustomScrollView(
    slivers: [
      SliverToBoxAdapter(
        child: Container(
          height: 200,
          color: Colors.red,
          alignment: Alignment.center,
          child: const Text('轮播图'),
        ),
      ),
     const SliverToBoxAdapter(
       child: SizedBox(height: 5,),
      ),
      SliverGrid.builder(
        gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
          crossAxisCount: 3,
          mainAxisSpacing: 5,
          crossAxisSpacing: 5,
         // childAspectRatio: 2/1,
         mainAxisExtent: 100
        ),
         itemBuilder: (context, index) {
          return Container(
            color: Colors.blue,
            height: 100,
            alignment: Alignment.center,
            child: const Text('传智教育'),
          );
         },
         itemCount: 10,
        
         ),
          const SliverToBoxAdapter(
           child: SizedBox(height: 5,),
         ),
         SliverList.separated(
          separatorBuilder: (context, index) {
            return const SizedBox(height: 5);
          },
           itemBuilder: ( context, index) {
            return Container(
              color: Colors.green,
              height: 100,
              alignment: Alignment.center,
              child:const Text('传智教育'),
            );
           },
         itemCount: 10,
         )
    ],
  );
  }
  
}